#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
<<<<<<< HEAD
@File Name  : Mzitu_mysql.py
=======
@File Name  : Mzitu_info.py
>>>>>>> 0f663d9cdbaca672411c54e3f484639a12f0b328
@Author     : LeeCQ
@Date-Time       : 2019/11/29 14:24

"""
import pymysql


<<<<<<< HEAD

=======
class MySQLInfo:
    """
    这个类存储Mzitu的数据库信息；
    简化数据库链接；

    """
    DB_host = 't.sql.leecq.xyz'  # 数据库 # 暂时未创建；
    DB_port = 62715
    DB_name = 'Mzitu'  # 今后可以在写文件的函数中追加 写数据库的函数
    DB_user = 'Mzitu'
    DB_passwd = 'Mzitu123456'
    DB_charset = 'utf8'

    sheet_ALL_ALBUM = 'mzitu'
    sheet_ALL_ALBUM_NO_JSON = 'mzitu_no_json'

    def MzituDB_connect(self):
        """
        :return 数据库链接句柄 - pymysql.connect对象
        ** host: Host where the database server is located
        ** user: Username to log in as
        ** password: Password to use.
        ** database: Database to use, None to not use a particular one.
        ** port: MySQL port to use, default is usually OK. (default: 3306)
        ** use_unicode:
            Whether or not to default to unicode strings.
            This option defaults to true for Py3k.
        ** client_flag: Custom flags to send to MySQL. Find potential values in constants.CLIENT.
        """
        return pymysql.connect(host=self.DB_host,
                               user=self.DB_user,
                               port=self.DB_port,
                               password=self.DB_passwd,
                               database=self.DB_name,
                               charset=self.DB_charset
                               )
>>>>>>> 0f663d9cdbaca672411c54e3f484639a12f0b328


if __name__ == '__main__':
    MySQLInfo().MzituDB_connect()
